
<template>
  <van-tabbar route fixed placeholder border active-color="#ee0a24">
    <van-tabbar-item
      :badge="item.hot ? dataStore.carNum : null"
      v-for="(item, index) in foots"
      :key="index"
      replace
      :to="{ name: item.name }"
      :icon="item.icon"
    >
      {{ item.text }}
    </van-tabbar-item>
  </van-tabbar>
</template>

<script lang="ts" setup>
// import { computed } from "vue";
import { useDataStore } from "../store/data";

const dataStore = useDataStore();
console.log(dataStore);

// const carNum = computed(() => dataStore.carNum);
const foots: Array<ActionType> = [
  {
    path: "/shop/home",
    name: "home",
    text: "首页",
    icon: "home-o",
  },
  {
    path: "/shop/find",
    name: "find",
    text: "分类",
    icon: "apps-o",
  },
  {
    path: "/shop/cart",
    name: "cart",
    text: "购物车",
    icon: "shopping-cart-o",
    hot: true,
  },
  {
    path: "/shop/mine",
    name: "mine",
    text: "我的",
    icon: "contact-o",
  },
];
</script>